<template>
	<view class="scrool-page">
		<view class="list-cont">
			<scroll-view class="scrool-more" style="height: 100%" scroll-y="true" scroll-with-animation="true">
				<view v-for="(item,index) in productList" :key="index">
					<uni-card :title="'序号:'+(index+1)">
						<!-- <text class="uni-body">物料编码：{{ item.itemCode }}</text><br>
						<text class="uni-body">数量：{{ item.codeEqualQty }}</text><br> -->
						<text class="uni-body">箱码：{{ item.boxCode }}</text><br>
					</uni-card>
				</view>
			</scroll-view>
		</view>

		<view class="footer">
			<button type="default" size='mini' @click="reduceData" style="width:48%; margin-left:1%;"
				v-if="!userflag">减码</button>
			<button type="default" size='mini' @click="reduceData" style="width:48%; margin-left:1%;" v-else>加箱</button>
			<button type="default" size='mini' @click="submit" style="width:48%; margin-left:1%;">完成</button>
		</view>
		<uni-popup ref="CreateNewBarcode" type="dialog" :is-mask-click="false">
			<uni-popup-dialog type="success" cancelText="关闭" confirmText="确定" title="提示" :before-close="true"
				content="此物料不属于此库位,是否加入此库位" @confirm="CreateNewBarcodeConfirm" @close="CreateNewBarcodeClose">
			</uni-popup-dialog>
		</uni-popup>

		<uni-popup ref="alertDialog" type="dialog" :is-mask-click="false">
			<uni-popup-dialog type="success" cancelText="关闭" confirmText="确定" title="提示" :before-close="true"
				:content="content" @confirm="dialogConfirm" @close="dialogClose">
			</uni-popup-dialog>
		</uni-popup>

		<uni-popup ref="reduceDialog" type="dialog" :is-mask-click="false">
			<uni-popup-dialog type="success" cancelText="关闭" confirmText="确定" title="提示" :before-close="true"
				:content="reduceContent" @confirm="reduceConfirm" @close="reduceClose">
			</uni-popup-dialog>
		</uni-popup>

		<uni-popup ref="messageDialog" type="dialog" :is-mask-click="false">
			<uni-popup-dialog type="success" cancelText="关闭" confirmText="确定" title="此箱号系统中没有记录，请重新录入信息"
				:before-close="true" :content="messageeContent" @confirm="messageConfirm" @close="messageClose">
			</uni-popup-dialog>
		</uni-popup>

		<!-- <uni-popup ref="dataDialog" type="dialog" :is-mask-click="false">
			<uni-popup-dialog type="success" cancelText="关闭" confirmText="确定" title="提示" :before-close="true" :content="dataContent" @confirm="dataConfirm"
				@close="dataClose">
			</uni-popup-dialog>
		</uni-popup> -->
	</view>
</template>

<script>
	import {
		LocationDetails
	} from '@/api/system/interfaceFile.js'
	import {
		debounce,
		deepClone
	} from '@/api/system/Tool.js'
	import {
		getToken
	} from '@/utils/auth';
	import common from '../../pages/common/common.js'
	var main, receiver, filter;
	var ScanDeviceClass = plus.android.importClass("android.device.ScanDevice");
	var scanDevice;
	export default {
		data() {
			return {
				timer: null,
				productList: [],
				content: '',
				code: '',
				codeEqualQty: '',
				boxCode: '',
				count: 0,
				userflag: true,
				codeStr: '',
				popFlag: false,
				reduceContent: '',
				reduceCode: '',
				reduceNumkber: '',
				reducePatch: '',
				reduceCount: 0,
				barcodeIdList: [],
				dataContent: '检测到有缓存数据是否加载？',
				messageeContent: '确认删除数据吗?',
				sumbitFlag: false,
				baseUrl: getApp().globalData.config.baseUrl,
				userName: this.$store.state.user.name,
				orgId: getApp().globalData.config.orgId,
				storageLocation: '',
				batchNumber: '',
				pkOrder: '',
				lineId: '',
				areaId: '',
				numOld: '',
				itemCodeOld: '',
				tasktype: '',
				itemIds: '',
				NoStorageSpaceAvailable: [],
				resultData: [],
				areaCode: null,
				pagaData: null
			}
		},

		created: function() {
			this.orgId = uni.getStorageSync('orgId');
			this.content = '';
			this.code = '';
			this.codeEqualQty = '';
			this.boxCode = '';
			this.count = 0;

			this.codeStr = '';
			this.popFlag = false;
			this.reduceContent = '';
			this.reduceCode = '';
			this.reduceNumkber = '';
			this.reducePatch = '';
			this.reduceCount = 0;
			this.barcodeIdList = [];
		},

		onShow() {

			scanDevice = new ScanDeviceClass();
			scanDevice.openScan(); // 打开扫描
			scanDevice.setOutScanMode(0); // 扫描模式				
			this.initScan();
			this.registerScan();
		},

		onHide: function() {
			this.unregisterScan();
		},

		destroyed: function() {
			this.unregisterScan();
		},

		onLoad: function(option) {
			if (option.detailList) {
				this.pagaData = JSON.parse(option.detailList)
			}

			this.areaCode = option.areaCode
			this.orgId = uni.getStorageSync('orgId');
			console.log(option)
			this.storageLocation = option.storageLocation;
			this.itemIds = option.itemIds;
			this.NoStorageSpaceAvailable = option.NoStorageSpaceAvailable
			console.log(option.storageLocation)
			this.batchNumber = option.batchNumber;
			this.tasktype = option.tasktype



			this.pkOrder = option.pkOrder
			//this.lineId = option.lineId;
			//this.numOld = option.numOld;
			//this.itemCodeOld = option.itemCodeOld;
			uni.setNavigationBarTitle({
				title: this.storageLocation + '重新扫箱码'
			})
		},


		methods: {
			initScan(popFlag) {
				let _this = this;
				main = plus.android.runtimeMainActivity(); //获取activity  
				var IntentFilter = plus.android.importClass('android.content.IntentFilter');
				filter = new IntentFilter();
				filter.addAction("scan.rcv.message"); // 换你的广播动作  
				receiver = plus.android.implements('io.dcloud.feature.internal.reflect.BroadcastReceiver', {
					onReceive: function(context, intent) {
						plus.android.importClass(intent);
						let code = intent.getByteArrayExtra('barocode');
						let codeStr = common.utf8ByteToUnicodeStr(code);
						console.log(_this.userflag, 'this.userflag')
						if (!_this.userflag) {
							_this.viewScan(codeStr);
						} else {
							_this.buttonScan(codeStr);
						}






					}
				});
			},

			reduceData() {

				this.userflag = !this.userflag
				console.log(this.userflag)
				// if (this.userflag) {
				// 	this.userflag = false;
				// } else {
				// 	this.userflag = true;
				// }
				//this.$refs.messageDialog.open();			
			},

			// reduceData(){
			// 	this.userflag = true;
			// },

			//如果是机器上面的扫描按钮，是增加数据
			buttonScan(codeStr) {

				uni.showLoading({
					title: '加载中',
					mask: true
				});
				var that = this;
				// if (that.userflag) {
				// 	return;
				// }
				if (codeStr == null || codeStr == '') {
					//隐藏加载框
					uni.hideLoading();
					uni.showToast({
						title: '未扫描到任何数据',
						icon: 'none',
						duration: 5000
					});
					return;
				}
				var result = common.scanCode(codeStr);
				console.log(result, 'result')
				if (!that.popFlag) {
					if (result[0] != "C") {
						//隐藏加载框
						uni.hideLoading();
						uni.showToast({
							title: '请扫描箱号',
							icon: 'none',
							duration: 5000
						});
						return;
					}
				}
				if (result[0] == 'P') {
					//隐藏加载框
					uni.hideLoading();
					that.code = result[1];
					that.count = parseInt(that.count) + 1;
					that.content = '物料编码：' + that.code + "\n" + "数量：" + that.codeEqualQty + "\n" + '箱码：' + that.boxCode +
						'\n';
				} else if (result[0] == 'Q') {
					//隐藏加载框
					uni.hideLoading();
					that.codeEqualQty = result[1];
					that.count = parseInt(that.count) + 1;
					that.content = '物料编码：' + that.code + "\n" + "数量：" + that.codeEqualQty + "\n" + '箱码：' + that.boxCode +
						'\n';
				} else if (result[0] == 'C') {
					for (var i = 0; i < that.productList.length; i++) {
						if (that.productList[i].boxCode == result[1]) {
							//隐藏加载框
							uni.hideLoading();
							uni.showToast({
								title: '此数据已存在',
								icon: 'error',
								duration: 2000
							});
							return;
						}
					}
					//隐藏加载框
					uni.hideLoading();
					that.boxCode = result[1];
					if (that.popFlag) {
						that.count = parseInt(that.count) + 1;
						that.content = '物料编码：' + that.code + "\n" + "数量：" + that.codeEqualQty + "\n" + '箱码：' + that
							.boxCode + '\n';
					} else {
						that.queryByBoxCode(result[1]);
					}
				} else {
					uni.showToast({
						title: '请扫描正确的条码',
						icon: 'none',
						duration: 5000
					});
					return;
				}
			},

			queryByBoxCode(boxCode) {
				uni.showLoading({
					title: '加载中',
					mask: true
				});
				var that = this;
				//根据箱号查询条码主档
				uni.request({

					url: that.baseUrl + '/system/barcode/box1',
					data: {
						userName: that.userName,
						boxCode: boxCode,
						orgId: that.orgId,
					},
					method: 'POST',
					header: {
						'authorization': getToken()
					},
					dataType: 'json',
					success: (res) => {



						console.log('扫码', res)

				





						if (res.data.code == '200' || res.data.code == 200) {
							const dataItemIds = uni.getStorageSync('materialData')
							console.log('materialData', dataItemIds)
							// console.log(dataItemIds.includes(res.data.data.itemId),!dataItemIds.includes(res.data.data.itemId))
							
							if (dataItemIds != '') {
								if (!dataItemIds.includes(res.data.data.itemId)) {
									uni.showToast({
										title: '本次所扫条码对应的物料不属于此次盘点范围内',
										icon: 'none',
										duration: 2000
									});
							
									return
								}
							}
							//隐藏加载框
							uni.hideLoading();
							this.resultData = []

							this.resultData = res.data.data;

							let arr = []
							let ARRboler = false
							console.log(this.itemIds, this.resultData.storageArea, this.storageLocation)

							if (this.itemIds && this.resultData.storageArea != this.storageLocation) {

								if (this.itemIds.indexOf(',') != -1) {
									arr = this.itemIds.split(',')
								} else {
									arr.push(this.itemIds)
								}
								ARRboler = arr.some(item => this.resultData.itemId == item)

								if (!ARRboler) {
									this.$refs.CreateNewBarcode.open()
									return
								}

							}
							console.log('测试113')

							var tempList = { 
								itemCode: this.resultData.itemCode,
								codeEqualQty: this.resultData.codeEqualQty,
								boxCode: this.resultData.boxCode,
								itemName: this.resultData.itemName,
								isBarcode: '1'
							};
							that.productList.push(tempList);
							console.log(that.productList, 'that.productList')
						} else if (res.data.code == '500') {
							uni.showToast({
								duration: 5000,
								icon: 'none',
								title: res.data.msg
							})
						} else {
							//隐藏加载框
							uni.hideLoading();
							that.popFlag = true;
							that.$refs.alertDialog.open();
							that.boxCode = boxCode;
							that.content = '物料编码：' + that.code + "\n" + "数量：" + that.codeEqualQty + "\n" +
								'箱码：' + that.boxCode + '\n';
						}

					},
				})
			},

			//如果是页面上的减码扫描，那就是删除数据
			viewScan(codeStr) {

				uni.showLoading({
					title: '加载中',
					mask: true
				});
				var result = common.scanCode(codeStr);
				if (result[0] != "C") {
					//隐藏加载框
					uni.hideLoading();
					uni.showToast({
						title: '请扫描箱号',
						icon: 'none',
						duration: 5000
					});
				} else {
					var tempList = [];
					var flag = false;
					for (var i = 0; i < this.productList.length; i++) {
						if (this.productList[i].boxCode == result[1]) {
							flag = true;
						} else {
							tempList.push(this.productList[i]);
						}
					}
					if (flag) {
						this.productList = tempList;
					} else {
						uni.hideLoading();
						uni.showToast({
							title: '此箱号不存在',
							icon: 'none',
							duration: 5000
						});
					}
				}
				//隐藏加载框
				uni.hideLoading();

			},

			submit() {
				
				
				 var that = this;
				uni.showModal({
				    title: '确认提交',
				    content: '数据将提交给PC端更新进度和结果是否继续？',
				    success: function (res) {
				        if (res.confirm) {
				         
						 let exceptionListVALUE = true
						 
						 uni.setStorageSync('exceptionListVALUE', exceptionListVALUE)
						 uni.showLoading({
						 	title: '加载中',
						 	mask: true
						 });
						
						 let prevPage = null
						 let pages = getCurrentPages(); //获取所有页面栈实例列表
						 let nowPage = pages[pages.length - 1]; //当前页页面实例
						 if (this.tasktype == '初盘') {
						 	prevPage = pages[pages.length - 3]; //上一页页面实例
						 } else {
						 	prevPage = pages[pages.length - 2]; //上一页页面实例
						 }
						 
						 
						 var detailList = prevPage?.$vm?.productList;
						 var qtyCheck = 0;
						 var boxCount = 0;
						 console.log(detailList)
						 if (detailList) {
						 	for (var i = 0; i < detailList.length; i++) {
						 		if (detailList[i].areaCode == that.storageLocation) {
						 			//detailList[i].qtyCheck = that.productList.length;
						 			qtyCheck = detailList[i].qtyCheck;
						 			boxCount = detailList[i].boxCount;
						 			detailList[i].attr9 = "2";
						 			break;
						 		}
						 	}
						 }
						 
						 var tempList = {
						 	areaCode: that.storageLocation,
						 	qtyCheck: qtyCheck,
						 	boxCount: boxCount,
						 	list: that.productList
						 };
						 
						 var list = [];
						 
						 var exceptionList = prevPage?.$vm?.exceptionList;
						 console.log(that.productList, 'that.productList')
						 console.log('exceptionList', exceptionList)
						 if (exceptionList) {
						 	for (var i = 0; i < exceptionList.length; i++) {
						 		if (exceptionList[i].areaCode != that.storageLocation) {
						 			list.push(exceptionList[i]);
						 		}
						 	}
						 
						 }
						 
						 console.log('this.productList', that.productList, uni.getStorageSync('tasktype'))
						 console.log('this.pagaData', that.pagaData, that.tasktype)
						 // prevPage.$vm.exceptionList = list;
						 // list.push(tempList);
						 uni.setStorageSync('boole', false)
						 if (that.tasktype == '') {
						 	that.tasktype = uni.getStorageSync('tasktype')
						 }
						 console.log('this.tasktype', that.tasktype,uni.getStorageSync('tasktype'))
						
						 
						 
						 if (that.tasktype == '初盘') {
						 
						 uni.setStorageSync('list', that.productList)
						 uni.setStorageSync('ScanCodeData', that.productList)
						 
						 
						 uni.setStorageSync('shouldCheck', false)
						 uni.hideLoading();
						 
						 	uni.navigateBack({ //uni.navigateTo跳转的返回，默认1为返回上一级
						 		delta: 1
						 	});
						 } else {
						 	console.log('123')
						 	let dataList = ''
						 	if (that.productList.length > 0) {
						 
						 		let arr = deepClone(that.productList)
						 		console.log('深拷贝', arr)
						 		let arrData = []
						 
						 
						 
						 		console.log('arrData', arr)
						 
						 		const groupedItems = arr.reduce((acc, curr) => {
						 			console.log('acc, curr', acc, curr)
						 			if (!acc[curr.itemCode]) {
						 				acc[curr.itemCode] = [];
						 
						 			}
						 
						 			acc[curr.itemCode].push(curr);
						 			// 	// 返回累积器，以便下一次迭代  
						 			return acc;
						 		}, {});
						 		console.log('groupedItems', groupedItems, Object.entries(groupedItems))
						 		const result = Object.entries(groupedItems).map(([itemCode, values]) => ({
						 			itemCode, // 直接使用键作为 itemCode  
						 
						 			list: values // 使用值作为具有相同 itemCode 的对象数组  
						 		}));
						 
						 
						 		console.log('result', result)
						 
						 		let Code = that.storageLocation
						 		arrData = result.map((item) => {
						 			console.log('item', item, Code)
						 			let obj = item.list[0]
						 			return {
						 				...obj,
						 				Count: item.list.length,
						 				areaCode: Code,
						 				list: [],
						 
						 			}
						 		})
						 		arrData.forEach(item => {
						 
						 			that.productList.forEach(i => {
						 				if (item.itemCode == i.itemCode) {
						 					item.list.push(i)
						 				}
						 			})
						 		})
						 
						 
						 
						 
						 
						 
						 
						 		dataList = JSON.stringify(arrData)
						 		console.log('dataList', dataList)
						 	}
						 	uni.navigateTo({ //uni.navigateTo跳转的返回，默认1为返回上一级
						 			url: `/pages/special/wms_check_order_detaile?dataList=${dataList}&tasktype=${that.tasktype}`
						 		}).then(() => {
						 			// 页面跳转成功的处理
						 			console.log('跳转成功');
						 		})
						 		.catch((error) => {
						 			// 捕捉异步错误并进行处理
						 			console.error('导航到页面发生错误:', error);
						 		});
						 
						 
						 
						 
						 
						 
						 
						 
						 
						 }
						 
						 console.log('测试', list)
						 
				            // 用户点击了确定按钮的相关逻辑可以放在这里
				        } else if (res.cancel) {
				           
				            // 用户点击了取消按钮的相关逻辑可以放在这里
				        }
				    }
				});
				




				//that.unregisterScan();

				// if (this.tasktype == '初盘') {
				// 	// setTimeout(function() {
				// 	// 	uni.navigateBack({ //uni.navigateTo跳转的返回，默认1为返回上一级
				// 	// 		delta: 1
				// 	// 	});
				// 	// }, 1000);
				// 	uni.navigateBack({ //uni.navigateTo跳转的返回，默认1为返回上一级
				// 		delta: 1
				// 	});
				// } else {
				// 	setTimeout(function() {
				// 		uni.navigateBack({ //uni.navigateTo跳转的返回，默认1为返回上一级
				// 			delta: 1
				// 		});
				// 	}, 1000);
				// }

			},

			submitOld() {
				uni.showLoading({
					title: '加载中',
					mask: true
				});
				var that = this;
				let pages = getCurrentPages(); //获取所有页面栈实例列表
				let nowPage = pages[pages.length - 1]; //当前页页面实例
				let prevPage = pages[pages.length - 2]; //上一页页面实例
				console.log(prevPage, 'prevPage')
				var detailList = prevPage.$vm.detailList;
				if (that.numOld == that.productList.length) {
					for (var i = 0; i < detailList.length; i++) {
						if (detailList[i].itemCode == that.itemCodeOld) {
							detailList[i].qtyCheck = that.productList.length;
							break;
						}
					}
					//隐藏加载框
					uni.hideLoading();
					uni.showToast({
						title: that.itemCodeOld + '物料账实一致，已修改为正确的箱数',
						icon: 'none',
						duration: 5000
					});
				} else {
					for (var i = 0; i < that.productList.length; i++) {
						var data = that.productList[i];
						var tempList = {
							boxCode: data.boxCode,
							batchNumber: data.boxCode.substring(0, 9),
							itemCode: data.itemCode,
							qtyCheck: data.codeEqualQty,
							isBarcode: data.isBarcode
						};
						prevPage.$vm.boxCodeException.push(tempList);
					}
					for (var i = 0; i < detailList.length; i++) {
						if (detailList[i].itemCode == that.itemCodeOld) {
							detailList[i].handleFlag = 'true';
							break;
						}
					}
					//隐藏加载框
					uni.hideLoading();
					uni.showToast({
						title: that.itemCodeOld + '物料账实不符，已添加至盘点差异单列表中',
						icon: 'none',
						duration: 5000
					});
				}
				//that.unregisterScan();
				setTimeout(function() {
					uni.navigateBack({ //uni.navigateTo跳转的返回，默认1为返回上一级
						delta: 1
					});
				}, 1000);
			},

			registerScan() {
				main.registerReceiver(receiver, filter);
			},

			unregisterScan() {
				main.unregisterReceiver(receiver);
			},
			CreateNewBarcodeClose() {
				this.$refs.CreateNewBarcodeClose.close();
			},




			CreateNewBarcodeConfirm() {

				// let timer = null
				let vueContext = this
				debounce(() => {
					var tempList = {
						itemCode: vueContext.resultData.itemCode,
						codeEqualQty: vueContext.resultData.codeEqualQty,
						itemName: vueContext.resultData.itemName,
						boxCode: vueContext.resultData.boxCode,
						isBarcode: '1',
					};
					// vueContext.productList.push(tempList);
					vueContext.$refs.CreateNewBarcode.close();
					vueContext.productList.push(tempList)

				}, 500)

				// if (this.timer) {
				// 	clearTimeout(this.timer)
				// }
				// this.timer = setTimeout(() => {
				// 	var tempList = {
				// 		itemCode: vueContext.resultData.itemCode,
				// 		codeEqualQty: vueContext.resultData.codeEqualQty,
				// 		boxCode: vueContext.resultData.boxCode,
				// 		isBarcode: '1',
				// 	};
				// 	vueContext.productList.push(tempList);
				// 	vueContext.$refs.CreateNewBarcode.close();

				// }, 500)


				console.log(vueContext)

			},

			dialogConfirm() {
				uni.showLoading({
					title: '加载中',
					mask: true
				});
				//如果三个码都扫描完成
				console.log('123123’')
				var that = this;
				if (that.code == null || that.code == '') {
					//隐藏加载框
					uni.hideLoading();
					uni.showToast({
						title: '请扫描物料编码',
						icon: 'error',
						duration: 2000
					});
					return;
				} else if (that.codeEqualQty == null || that.codeEqualQty == '') {
					//隐藏加载框
					uni.hideLoading();
					uni.showToast({
						title: '请扫描数量',
						icon: 'error',
						duration: 2000
					});
					return;
				} else if (that.boxCode == null || that.boxCode == '') {
					//隐藏加载框
					uni.hideLoading();
					uni.showToast({
						title: '请扫描箱码',
						icon: 'error',
						duration: 2000
					});
					return;
				} else {
					uni.request({
						url: that.baseUrl + '/system/barcode/box',
						data: {

							boxCode: that.boxCode,
							orgId: that.orgId,
						},
						method: 'POST',
						header: {
							'authorization': getToken()
						},
						dataType: 'json',
						success: (res) => {
							console.log(res)
							if (res.data.code == '200' || res.data.code == 200) {
								var tempList = {
									itemCode: that.code,
									codeEqualQty: that.codeEqualQty,
									boxCode: that.boxCode,
									isBarcode: '0'
								};
								that.productList.push(tempList);
								that.code = '';
								that.codeEqualQty = '';
								this.boxCode = '';
								that.count = '0';
								that.popFlag = false;
								//隐藏加载框
								uni.hideLoading();
								that.$refs.alertDialog.close();
							} else {
								uni.showToast({
									title: '此箱码不在条码主档中',
									icon: 'none',
									duration: 5000
								});
								that.code = '';
								that.codeEqualQty = '';
								that.boxCode = '';
								that.content = '物料编码：' + that.code + "\n" + "数量：" + that.codeEqualQty + "\n" +
									'箱码：' + that.boxCode + '\n';
							}

						},
					})




				}
			},

			dialogClose() {
				this.code = '';
				this.codeEqualQty = '';
				this.boxCode = '';
				this.count = '0';
				this.popFlag = false;
				this.$refs.alertDialog.close();
			},

			reduceConfirm() {
				//if(this.reduceCount == 3){
				var tempList = [];
				for (var i = 0; i < this.productList.length; i++) {
					if (this.productList[i].boxCode == this.reducePatch) {

					} else {
						tempList.push(this.productList[i]);
					}
				}
				this.productList = [];
				this.productList = tempList;
				this.$refs.reduceDialog.close();
				this.reduceCode = '';
				this.reduceNumkber = '';
				this.reducePatch = '';
				this.reduceCount = 0;
				this.userflag = false;
				// }else{
				// 	uni.showToast({
				// 		title: '请正确扫描物料信息',
				// 		icon: 'error',
				// 		duration: 2000
				// 	});
				// 	return;
				// }

			},

			reduceClose() {
				this.reduceCode = '';
				this.reduceNumkber = '';
				this.reducePatch = '';
				this.reduceCount = 0;
				this.userflag = false;
				this.$refs.reduceDialog.close();
			},

			dataConfirm() {
				this.productList = this.list;
				this.$refs.dataDialog.close();
			},

			dataClose() {
				this.list = [];
				try {
					uni.removeStorageSync('product_recpt');
				} catch (e) {
					console.log(e.message);
				}
				this.productList = [];
				this.$refs.dataDialog.close();
			},

			messageConfirm() {
				scanDevice.stopScan(); // 停止扫描
				scanDevice.startScan();
				this.$refs.messageDialog.close();
			},

			messageClose() {
				this.userflag = false;
				this.$refs.messageDialog.close();
			},
		}
	}
</script>

<style lang="scss">
	.main {
		background-color: #fff;
		height: 300upx;
		align-items: center;
		margin-top: 10upx;
	}

	.text-content {
		font-size: 48rpx;
		text-align: center;
	}

	.city {
		/* #ifndef APP-PLUS-NVUE */
		display: flex;
		/* #endif */
		flex-direction: row;
		align-items: center;
		justify-content: flex-start;
		// width: 160rpx;
		margin-left: 4px;
		font-size: 26rpx;
	}

	.input-view {
		display: flex;
		flex-direction: row;
		flex: 1;
		//background-color: #f8f8f8;
		height: 30px;
		padding: 0 80px;
		flex-wrap: nowrap;
		margin: 7px 0;
		line-height: 30px;
		font-size: 26rpx;
	}

	page {
		width: 100%;
		height: 100%;
	}


	.scrool-page {
		display: flex;
		flex-direction: column;
		width: 100%;
		height: 100%;
	}

	.header-cont {
		width: 100%;
		height: 110rpx;
		line-height: 100rpx;
		text-align: center;
		// background: red;
	}

	.list-cont {
		flex: 1;
		position: relative;

		.scrool-more {
			position: absolute;
			left: 0;
			right: 0;
			top: 0;
			bottom: 0;
		}

		.list {
			height: 80rpx;
			line-height: 80rpx;
			text-align: center;
			background: #e0e0e0;

		}
	}


	.footer {
		color: #fff;
		line-height: 100rpx;
		flex: 0 0 100rpx;
		/* 不放大不缩小固定100rpx */
	}
</style>